package com.xiyuan.action;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.xiyuan.dao.FamilyMapper;
import com.xiyuan.entity.Family;

/**    
 * @author：wujinxing   
 * @since：2016-2-27 下午6:25:06 
 * @version:   1.0
 * @function: 
 */
@Controller
public class FamilyAction {


	@Autowired
	private FamilyMapper familyMapper;

	@RequestMapping(value = "/family_detail.jsp")
	public String detail(@RequestParam(value = "id", required = false) String id
			,ModelMap modelMap) {

		if (StringUtils.isBlank(id)) {
			return "500";
		}
		List<Family> familys = familyMapper.selectByHyid(Integer.valueOf(id));
		modelMap.put("familys", familys);
		modelMap.put("id", id);
		return "/family_detail";
	}
}
